import 'package:hotpot/generated/json/base/json_convert_content.dart';
import 'package:hotpot/models/res_partner.dart';

ResPartner $ResPartnerFromJson(Map<String, dynamic> json) {
	final ResPartner resPartner = ResPartner();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		resPartner.id = id;
	}
	final String? image128 = jsonConvert.convert<String>(json['image_128']);
	if (image128 != null) {
		resPartner.image128 = image128;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		resPartner.name = name;
	}
	final List<String>? parentId = jsonConvert.convertListNotNull<String>(json['parent_id']);
	if (parentId != null) {
		resPartner.parentId = parentId;
	}
	final String? parentName = jsonConvert.convert<String>(json['parent_name']);
	if (parentName != null) {
		resPartner.parentName = parentName;
	}
	final List<int>? childIds = jsonConvert.convertListNotNull<int>(json['child_ids']);
	if (childIds != null) {
		resPartner.childIds = childIds;
	}
	final List<String>? userId = jsonConvert.convertListNotNull<String>(json['user_id']);
	if (userId != null) {
		resPartner.userId = userId;
	}
	final String? vat = jsonConvert.convert<String>(json['vat']);
	if (vat != null) {
		resPartner.vat = vat;
	}
	final String? street = jsonConvert.convert<String>(json['street']);
	if (street != null) {
		resPartner.street = street;
	}
	final String? zip = jsonConvert.convert<String>(json['zip']);
	if (zip != null) {
		resPartner.zip = zip;
	}
	final String? city = jsonConvert.convert<String>(json['city']);
	if (city != null) {
		resPartner.city = city;
	}
	final List<String>? stateId = jsonConvert.convertListNotNull<String>(json['state_id']);
	if (stateId != null) {
		resPartner.stateId = stateId;
	}
	final List<String>? countryId = jsonConvert.convertListNotNull<String>(json['country_id']);
	if (countryId != null) {
		resPartner.countryId = countryId;
	}
	final String? email = jsonConvert.convert<String>(json['email']);
	if (email != null) {
		resPartner.email = email;
	}
	final String? phone = jsonConvert.convert<String>(json['phone']);
	if (phone != null) {
		resPartner.phone = phone;
	}
	final String? mobile = jsonConvert.convert<String>(json['mobile']);
	if (mobile != null) {
		resPartner.mobile = mobile;
	}
	final List<String>? companyId = jsonConvert.convertListNotNull<String>(json['company_id']);
	if (companyId != null) {
		resPartner.companyId = companyId;
	}
	final String? companyName = jsonConvert.convert<String>(json['company_name']);
	if (companyName != null) {
		resPartner.companyName = companyName;
	}
	final String? barcode = jsonConvert.convert<String>(json['barcode']);
	if (barcode != null) {
		resPartner.barcode = barcode;
	}
	final List<String>? partnerId = jsonConvert.convertListNotNull<String>(json['partner_id']);
	if (partnerId != null) {
		resPartner.partnerId = partnerId;
	}
	return resPartner;
}

Map<String, dynamic> $ResPartnerToJson(ResPartner entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['image_128'] = entity.image128;
	data['name'] = entity.name;
	data['parent_id'] =  entity.parentId;
	data['parent_name'] = entity.parentName;
	data['child_ids'] =  entity.childIds;
	data['user_id'] =  entity.userId;
	data['vat'] = entity.vat;
	data['street'] = entity.street;
	data['zip'] = entity.zip;
	data['city'] = entity.city;
	data['state_id'] =  entity.stateId;
	data['country_id'] =  entity.countryId;
	data['email'] = entity.email;
	data['phone'] = entity.phone;
	data['mobile'] = entity.mobile;
	data['company_id'] =  entity.companyId;
	data['company_name'] = entity.companyName;
	data['barcode'] = entity.barcode;
	data['partner_id'] =  entity.partnerId;
	return data;
}